package com.zstu.mall.service;

import com.zstu.mall.entity.UserOrder;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 购物车
 */
public interface ShopCartService {

    String NAME_PREFIX = "shop_cart_";

    /**
     * 加购物车
     * @param
     */
    void addCart(String productId, HttpServletRequest request) throws Exception;

    /**
     * 移除
     * @param id
     * @param request
     */
    void remove(String id, HttpServletRequest request) throws Exception;

    /**
     * 查看购物车
     * @param request
     * @return
     */
    List<UserOrder> listCart(HttpServletRequest request) throws Exception;

    /**
     * 修改数量购物车
     * @param request
     * @return
     */
    void updateCart(String id, Double number, HttpServletRequest request) throws Exception;

}
